{extend name="template"}

{block name="body"}

<!-- 导航栏 -->
<div class="layui-row common-nav" style="width:100%;position:fixed;top:0;left:0;height:100px;z-index:90;">
    {include file="common/header" /}
</div>
<div id="search_form" style="display: none;z-index:1000;position:absolute;">
    {include file="common/search" /}
</div>

<!-- 轮播图 -->
<div class="layui-row list-carousel" style="position:fixed;top:100px;left:0;height:250px;z-index:80;">
    <img style="width:100%;height:100%;" src="__ROOT__/static/index/img/subbanner_04.jpg">
</div>

<div class="gas-index layui-fluid" style="width:100%;padding:10px 0 0;background-color:#f7f6f4;position:relative;margin-top:360px;z-index:110;">

    <div class="list-content layui-row margin-top-20">
        <div class="index-content">
            <div class="list" style="width:1024px">
                <div class="header" style="height:30px;">
                    <div class="pull-left name">{$title}</div>
                    <div class="pull-right breadcrumb">
                        <a style="color:inherit;" href="/">首页</a>->搜索
                    </div>
                </div>
                <div class="body-info">
                    {foreach news.list as $key=>$vo}
                    <dl>
                        <dt class="pull-left">
                            <div class="top"></div>
                            <div class="date">
                                <p class="day">{$vo.create_at|format_datetime='d'}</p>
                                <p>{$vo.create_at|format_datetime='Y-m'}</p>
                            </div>
                        </dt>
                        <dd class="pull-left" style="width:880px;">
                            <p class="title">
                                <a  href="/search/detail.html?id={$vo.id}">{$vo.title}</a>
                            </p>
                            <p class="abstract">{$vo.digest}</p>
                        </dd>
                    </dl>
                    {/foreach}
                </div>
                <div class="paging" id="test1"></div>
            </div>
        </div>
    </div>

    {include file="common/footer" /}

</div>

{/block}

{block name='style'}
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<script>if (location.href.indexOf('#') > -1) location.replace(location.href.split('#')[0])</script>
<link rel="stylesheet" href="__ROOT__/static/index/index.css">
{/block}

{block name='script'}
<script src="__ROOT__/static/index/index.js"></script>
<script>
    layui.use('carousel', function(){
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#carousel'
            ,width: '100%' //设置容器宽度
            ,height: '450px'
            ,arrow: 'always' //始终显示箭头
            //,anim: 'updown' //切换动画方式
        });
    });

    window.$= layui.$;
    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //执行一个laypage实例
        laypage.render({
            elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
            ,count: '{$news.pager.total}' //数据总数，从服务端得到
            ,limit:'{$news.pager.limit}'
            ,curr:'{$news.pager.page}'
        });
        $(".paging a").click(function () {
            var search_type = '{$search_type}';
            var $search_keyword = '{$search_keyword}';
            var curr = $(this).attr("data-page");
            location.href='/search/index.html?page='+curr+'&search-type='+search_type+'&search-keyword='+$search_keyword;
        });
    });
</script>
{/block}
